type go/parser.parser
98 uses
go/parser (current package)
interface.go#L96: var p parser
interface.go#L202: var p parser
parser.go#L31: type parser struct {
parser.go#L65: func (p *parser) init(fset *token.FileSet, filename string, src []byte, mode Mode) {
parser.go#L79: func (p *parser) allowGenerics() bool { return p.mode&typeparams.DisallowParsing == 0 }
parser.go#L80: func (p *parser) allowTypeSets() bool { return p.mode&typeparams.DisallowTypeSets == 0 }
parser.go#L85: func (p *parser) printTrace(a ...any) {
parser.go#L100: func trace(p *parser, msg string) *parser {
parser.go#L107: func un(p *parser) {
parser.go#L113: func (p *parser) next0() {
parser.go#L134: func (p *parser) consumeComment() (comment *ast.Comment, endline int) {
parser.go#L158: func (p *parser) consumeCommentGroup(n int) (comments *ast.CommentGroup, endline int) {
parser.go#L189: func (p *parser) next() {
parser.go#L227: func (p *parser) error(pos token.Pos, msg string) {
parser.go#L250: func (p *parser) errorExpected(pos token.Pos, msg string) {
parser.go#L268: func (p *parser) expect(tok token.Token) token.Pos {
parser.go#L279: func (p *parser) expect2(tok token.Token) (pos token.Pos) {
parser.go#L292: func (p *parser) expectClosing(tok token.Token, context string) token.Pos {
parser.go#L300: func (p *parser) expectSemi() {
parser.go#L317: func (p *parser) atComma(context string, follow token.Token) bool {
parser.go#L340: func (p *parser) advance(to map[token.Token]bool) {
parser.go#L410: func (p *parser) safePos(pos token.Pos) (res token.Pos) {
parser.go#L423: func (p *parser) parseIdent() *ast.Ident {
parser.go#L435: func (p *parser) parseIdentList() (list []*ast.Ident) {
parser.go#L453: func (p *parser) parseExprList() (list []ast.Expr) {
parser.go#L467: func (p *parser) parseList(inRhs bool) []ast.Expr {
parser.go#L478: func (p *parser) parseType() ast.Expr {
parser.go#L495: func (p *parser) parseQualifiedIdent(ident *ast.Ident) ast.Expr {
parser.go#L509: func (p *parser) parseTypeName(ident *ast.Ident) ast.Expr {
parser.go#L530: func (p *parser) parseArrayType(lbrack token.Pos, len ast.Expr) *ast.ArrayType {
parser.go#L558: func (p *parser) parseArrayFieldOrTypeInstance(x *ast.Ident) (*ast.Ident, ast.Expr) {
parser.go#L616: func (p *parser) parseFieldDecl() *ast.Field {
parser.go#L671: func (p *parser) parseStructType() *ast.StructType {
parser.go#L697: func (p *parser) parsePointerType() *ast.StarExpr {
parser.go#L708: func (p *parser) parseDotsType() *ast.Ellipsis {
parser.go#L724: func (p *parser) parseParamDecl(name *ast.Ident, typeSetsOK bool) (f field) {
parser.go#L807: func (p *parser) parseParameterList(name0 *ast.Ident, typ0 ast.Expr, closing token.Token) (params []*ast.Field) {
parser.go#L936: func (p *parser) parseParameters(acceptTParams bool) (tparams, params *ast.FieldList) {
parser.go#L968: func (p *parser) parseResult() *ast.FieldList {
parser.go#L988: func (p *parser) parseFuncType() *ast.FuncType {
parser.go#L1003: func (p *parser) parseMethodSpec() *ast.Field {
parser.go#L1085: func (p *parser) embeddedElem(x ast.Expr) ast.Expr {
parser.go#L1104: func (p *parser) embeddedTerm() ast.Expr {
parser.go#L1128: func (p *parser) parseInterfaceType() *ast.InterfaceType {
parser.go#L1182: func (p *parser) parseMapType() *ast.MapType {
parser.go#L1196: func (p *parser) parseChanType() *ast.ChanType {
parser.go#L1221: func (p *parser) parseTypeInstance(typ ast.Expr) ast.Expr {
parser.go#L1254: func (p *parser) tryIdentOrType() ast.Expr {
parser.go#L1293: func (p *parser) parseStmtList() (list []ast.Stmt) {
parser.go#L1305: func (p *parser) parseBody() *ast.BlockStmt {
parser.go#L1317: func (p *parser) parseBlockStmt() *ast.BlockStmt {
parser.go#L1332: func (p *parser) parseFuncTypeOrLit() ast.Expr {
parser.go#L1353: func (p *parser) parseOperand() ast.Expr {
parser.go#L1395: func (p *parser) parseSelector(x ast.Expr) ast.Expr {
parser.go#L1405: func (p *parser) parseTypeAssertion(x ast.Expr) ast.Expr {
parser.go#L1423: func (p *parser) parseIndexOrSliceOrInstance(x ast.Expr) ast.Expr {
parser.go#L1514: func (p *parser) parseCallOrConversion(fun ast.Expr) *ast.CallExpr {
parser.go#L1540: func (p *parser) parseValue() ast.Expr {
parser.go#L1554: func (p *parser) parseElement() ast.Expr {
parser.go#L1569: func (p *parser) parseElementList() (list []ast.Expr) {
parser.go#L1585: func (p *parser) parseLiteralValue(typ ast.Expr) ast.Expr {
parser.go#L1602: func (p *parser) checkExpr(x ast.Expr) ast.Expr {
parser.go#L1644: func (p *parser) checkExprOrType(x ast.Expr) ast.Expr {
parser.go#L1659: func (p *parser) parsePrimaryExpr(x ast.Expr) ast.Expr {
parser.go#L1726: func (p *parser) parseUnaryExpr() ast.Expr {
parser.go#L1795: func (p *parser) tokPrec() (token.Token, int) {
parser.go#L1808: func (p *parser) parseBinaryExpr(x ast.Expr, prec1 int, check bool) ast.Expr {
parser.go#L1833: func (p *parser) checkBinaryExpr(x ast.Expr) {
parser.go#L1851: func (p *parser) parseExpr() ast.Expr {
parser.go#L1859: func (p *parser) parseRhs() ast.Expr {
parser.go#L1867: func (p *parser) parseRhsOrType() ast.Expr {
parser.go#L1889: func (p *parser) parseSimpleStmt(mode int) (ast.Stmt, bool) {
parser.go#L1966: func (p *parser) checkAssignStmt(as *ast.AssignStmt) {
parser.go#L1974: func (p *parser) parseCallExpr(callType string) *ast.CallExpr {
parser.go#L1986: func (p *parser) parseGoStmt() ast.Stmt {
parser.go#L2001: func (p *parser) parseDeferStmt() ast.Stmt {
parser.go#L2016: func (p *parser) parseReturnStmt() *ast.ReturnStmt {
parser.go#L2032: func (p *parser) parseBranchStmt(tok token.Token) *ast.BranchStmt {
parser.go#L2047: func (p *parser) makeExpr(s ast.Stmt, want string) ast.Expr {
parser.go#L2065: func (p *parser) parseIfHeader() (init ast.Stmt, cond ast.Expr) {
parser.go#L2125: func (p *parser) parseIfStmt() *ast.IfStmt {
parser.go#L2155: func (p *parser) parseTypeList() (list []ast.Expr) {
parser.go#L2169: func (p *parser) parseCaseClause(typeSwitch bool) *ast.CaseClause {
parser.go#L2198: func (p *parser) isTypeSwitchGuard(s ast.Stmt) bool {
parser.go#L2219: func (p *parser) parseSwitchStmt() ast.Stmt {
parser.go#L2273: func (p *parser) parseCommClause() *ast.CommClause {
parser.go#L2329: func (p *parser) parseSelectStmt() *ast.SelectStmt {
parser.go#L2347: func (p *parser) parseForStmt() ast.Stmt {
parser.go#L2428: func (p *parser) parseStmt() (s ast.Stmt) {
parser.go#L2503: func (p *parser) parseImportSpec(doc *ast.CommentGroup, _ token.Pos, _ token.Token, _ int) ast.Spec {
parser.go#L2542: func (p *parser) parseValueSpec(doc *ast.CommentGroup, _ token.Pos, keyword token.Token, iota int) ast.Spec {
parser.go#L2579: func (p *parser) parseGenericType(spec *ast.TypeSpec, openPos token.Pos, name0 *ast.Ident, typ0 ast.Expr) {
parser.go#L2597: func (p *parser) parseTypeSpec(doc *ast.CommentGroup, _ token.Pos, _ token.Token, _ int) ast.Spec {
parser.go#L2725: func (p *parser) parseGenDecl(keyword token.Token, f parseSpecFunction) *ast.GenDecl {
parser.go#L2756: func (p *parser) parseFuncDecl() *ast.FuncDecl {
parser.go#L2812: func (p *parser) parseDecl(sync map[token.Token]bool) ast.Decl {
parser.go#L2841: func (p *parser) parseFile() *ast.File {